/**
 * File: RandomAccessFile.java
 * Created by: mhaimel
 * Created on: Aug 1, 2011
 * CVS:  $Id: RandomAccessFile.java 1.0 Aug 1, 2011 4:09:59 PM mhaimel Exp $
 */
package uk.ac.ebi.curtain.storage.sequence;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;

/**
 * @author mhaimel
 *
 */
public class InputRandomAccessFile implements InputRandomAccessStream {
	private final RandomAccessFile raf;

	public InputRandomAccessFile(File file) throws FileNotFoundException {
		this.raf = new RandomAccessFile(file, "r");
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int read(byte[] b, int off, int len) throws IOException {
		return raf.read(b, off, len);
	}

	/**
	 * {@inheritDoc}
	 * @throws IOException 
	 */
	@Override
	public void seek(long pos) throws IOException {
		this.raf.seek(pos);
	}

	@Override
	public void close() throws IOException {
		this.raf.close();
	}
}
